import request from '/@/utils/request';
import { IHrReportQuery, ITotalStatistics } from '/@/views/person/syspersonreport/api/interface';

interface ISysHrReportApi {
	getStatistics(params?: IHrReportQuery): Promise<ITotalStatistics>;
}

/**
 * 人事统计报表API
 */
function SysHrReportApi(): ISysHrReportApi {
	return {
		/**
		 * 获取统计数据
		 */
		async getStatistics(params?: IHrReportQuery): Promise<ITotalStatistics> {
			return await request({
				url: '/api/syspersonrepairbill/getstatistics',
				method: 'post',
				data: params, // 使用data而不是params，因为这是POST请求体
			});
		},
	};
}

export { SysHrReportApi };
